import React, { useContext, useEffect } from 'react';
import { CountContext } from '../userContext';

export const Context = () => {
    const { count, type } = useContext(CountContext);
    console.log('CountContext', CountContext);
    console.log(' useContext(CountContext)', useContext(CountContext));
    useEffect(() => {
        console.group('CountContext');
        console.log('count', count);
        console.log('type', type);
        console.groupEnd();
    });
    return <p>Context传入的counter: {count}</p>;
};
